package entity;
// default package

import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * Consumertypes entity.
 * 
 * @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "consumertypes", catalog = "house")
public class Consumertypes implements java.io.Serializable {

	// Fields

	private Integer id;
	private String TName;
	private Set<Consumer> consumers = new HashSet<Consumer>(0);

	// Constructors

	/** default constructor */
	public Consumertypes() {
	}

	/** minimal constructor */
	public Consumertypes(String TName) {
		this.TName = TName;
	}

	/** full constructor */
	public Consumertypes(String TName, Set<Consumer> consumers) {
		this.TName = TName;
		this.consumers = consumers;
	}

	// Property accessors
	@Id
	@GeneratedValue
	@Column(name = "id", unique = true, nullable = false)
	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	@Column(name = "t_name", nullable = false, length = 50)
	public String getTName() {
		return this.TName;
	}

	public void setTName(String TName) {
		this.TName = TName;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "consumertypes")
	public Set<Consumer> getConsumers() {
		return this.consumers;
	}

	public void setConsumers(Set<Consumer> consumers) {
		this.consumers = consumers;
	}

}